package com.example.seckill.scheduled;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

//@EnableScheduling
//@Component
@Slf4j
//@EnableAsync
public class HelloSchedule {

//    @Scheduled(cron = "5/5 * * * * 6")
    public void hello() {
        log.info("hello");
    }


    @Async
    @Scheduled(cron = "5/3 * * * * 6")
    public void hello2() {
        log.info("hello");
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
